<?php

namespace app\common\model;

use think\Model;

class AfterSale extends Model
{

    /**
     * 售后列表信息和商家信息
     * @param array $cond
     * @param array $param
     * @return \think\Paginator
     */
    static function list_($param=[],$cond=[])
    {
        $c = new self();
        #搜索订单号,用户名和电话号
        if (isset($param['search_']) && !empty($param['search_'])) {
            $search_ = $param['search_'];
            $cond["shop_after_sale.order_id|shop_after_sale.user_name|shop_after_sale.telephone"] = ["LIKE", "%$search_%"];
        }
        $data = $c
            ->field('shop_after_sale.*,shop_sellers.seller_name,shop_sellers.seller_address')
            ->join('shop_sellers','shop_after_sale.seller_id=shop_sellers.id')
            ->where($cond)
            ->order('shop_after_sale.id desc')
            ->paginate(30,false,['query'=>request()->param()]);
        return $data;
    }


}
